public class TradeOrder
{
	private Trader trader;
	private String symbol;
	private boolean buyOrder, marketOrder;
	private int numShares;
	private double price;
	
	public TradeOrder(Trader trader, String symbol, boolean buyOrder, boolean marketOrder, int numShares, double price)
	{
		this.trader = trader;
		this.symbol = symbol;
		this.buyOrder = buyOrder;
		this.marketOrder = marketOrder;
		this.numShares = numShares;
		this.price = price;
	}

	public Trader getTrader() 
	{
		return trader;
	}
	
	public String getSymbol() 
	{
		return symbol;
	}

	public boolean isBuy() 
	{
		return buyOrder;
	}

	public boolean isSell()
	{
		return !buyOrder;
	}
	public int getNumShares()
	{
		return numShares;
	}
	
	public boolean isMarket() 
	{
		return marketOrder;
	}
	public boolean isLimit()
	{
		return !marketOrder;
	}
	public void subtractShares(int numShares)
	{
		if (numShares > this.numShares) throw new IllegalArgumentException();
		this.numShares -= numShares;
	}

	public double getPrice()
	{
		return price;
	}
}
